home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / EmacsTeX / Emacs-3.0.1 / Source / PanelLoader.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  947 b   |  47 lines

  1. /* This nice class loads and displays various panels almost every app should
  2.    have.
  3.  
  4.    For legal stuff see the file COPYRIGHT.  */
  5.  
  6. #import "PanelLoader.h"
  7.  
  8. @implementation PanelLoader
  9.  
  10. /* Private Methods.  */
  11.  
  12. /* Load nib section `fileName' and order it to front.  Return FALSE on
  13.    failure and TRUE on success.  */
  14. -(BOOL) showPanel: (id *) panel fromFile: (const char *) fileName
  15. {
  16.   if (!*panel)
  17.     if (![NXApp loadNibSection: fileName owner: self])
  18.       {
  19.     perror (fileName);
  20.     return FALSE;
  21.       }
  22.   [*panel makeKeyAndOrderFront: self];
  23.   return TRUE;
  24. } /* -showPanel:fromFile: */
  25.  
  26. /* Public methods.  */
  27. -showHelp: sender
  28. {
  29.   [self showPanel: &helpPanel fromFile: "Help.nib"];
  30.   return self;
  31. } /* -showHelp: */
  32.  
  33. -showInfo: sender
  34. {
  35.   [self showPanel: &infoPanel fromFile: "Info.nib"];
  36.   return self;
  37. } /* -showInfo: */
  38.  
  39. -showPref: sender
  40. {
  41.   [self showPanel: &prefPanel fromFile: "Pref.nib"];
  42.   return self;
  43. } /* -showPref: */
  44.  
  45.  
  46. @end
  47.